package cn.hjh.util;

import cn.hjh.pojo.District;
import cn.hjh.service.DistrictBiz;

import java.io.IOException;

public class DistrictServlet extends HttpServlet {
    private DistrictBiz districtBiz = new DistrictBiz();

    public void doGet(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        String id = request.getParameter("id");
        District district = districtBiz.findDistrictById(new Integer(id));
        request.setAttribute("district", district);
        request.getRequestDispatcher("index.jsp").forward(request, response);
    }

    public void doPost(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        this.doGet(request, response);
    }
}
